#include "mm.h"
#include "typedef.h"

/*different possible states for a process to be in*/
#define 		BLOCKED		0
#define		RUNNABLE		1
#define		ZOMBIE		2

/*initial running time a process gets before it is swapped out*/
#define		INITIAL_QUANTUM	50

/*process types*/
#define 		NORMAL			0     /*ie interruptible*/
#define		NON-INTERRUPTABLE		1

/*stores register context at the state they are in before process is swapped out*/
typedef struct reg_context {
  u32 eax;
  u32 ebx;
  u32 ecx;
  u32 edx;
  u32 esp;
  u32 ebp;
  u32 eip;
} proc_regs;

typedef struct proc {
  u32 id;		
  u32 state;	
  proc_regs regs;
  u32 quantum;
  pde_t* vm_area;
} proc_t;

typedef struct proc_list {
  proc_t* prev;
  proc_t* next;
  proc_t proc;
} proc_list_t;


// gets process system running
void init_proc();

// given a pointer to code and length of code, sets up a new proces
// and returns its process id
u32 make_proc(u32*, u32);



